package com.test.pipleline;

import com.test.util.DownloadUtil;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

/**
 * @Author lizhilong
 * @create 2020/1/6 18:50
 * @desc
 */
public class DownLoadPipeline implements Pipeline {
    @Override
    public void process(ResultItems resultItems, Task task) {
        ImageEntity imageEntity = (ImageEntity) resultItems.get("ImageEntity");
        DownloadUtil.download(imageEntity.getImageUrl(), imageEntity.getImageName(), "C:\\Image2\\");

    }
}
